package bjtuoj;

import java.util.Scanner;

/**
 * ClassName: Test2
 * Description:
 * date: 2021-11-12 19:09
 *
 * @author liyifan
 */
//Ollie wins Stan wins
public class Test2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextInt()) {
            int C = scanner.nextInt();
            while (C-- > 0) {
                long M = scanner.nextLong();
                long N = scanner.nextLong();
                if (M < N){
                    long temp = M;
                    M = N;
                    N = temp;
                }
                int f;
                if(M / N > 1) f = 1;
                else{
                    int t = help(N, M % N);
                    if (t == 0)
                        f = 1;
                    else
                        f = 0;
                }

                if(f == 1)
                    System.out.printf("Stan wins\n");
                else
                    System.out.printf("Ollie wins\n");
            }
        }
    }

    public static int help(long x, long y){
        if(y == 0) return 0;
        if(x / y > 1) return 1;

        int res = help(y, x % y);
        if(res == 0){
            return 1;
        } else {
            return 0;
        }
    }
}
